import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '部门编码',
    align: "center",
    dataIndex: 'orgCode'
  },
  {
    title: '部门名称',
    align: "center",
    dataIndex: 'orgName'
  },
  {
    title: '部门类型',
    align: "center",
    dataIndex: 'orgType',
    customRender: ({ text }) => {
      return render.renderDict(text, 'hub_org_type');
    },
  },
  {
    title: '分析类型',
    align: "center",
    dataIndex: 'analysisType'
  },
  {
    title: '父部门编码',
    align: "center",
    dataIndex: 'parentOrgCode'
  },
  {
    title: '父部门名称',
    align: "center",
    dataIndex: 'parentOrgName'
  },
  {
    title: '适用单位',
    align: "center",
    dataIndex: 'suitUnit'
  },
  {
    title: '部门绩效兼职工号',
    align: "center",
    dataIndex: 'pluraList'
  },
  {
    title: '部门绩效兼职姓名',
    align: "center",
    dataIndex: 'pluraNameList'
  },
  {
    title: '部门负责人工号',
    align: "center",
    dataIndex: 'psnNum'
  },
  {
    title: '部门负责人名称',
    align: "center",
    dataIndex: 'psnName'
  },
  {
    title: '是否考核',
    align: "center",
    dataIndex: 'isAssess',
    editRow: true,
    editComponent: 'Switch',
  },
  {
    title: '显示排序',
    align: "center",
    dataIndex: 'displayOrder'
  },
  {
    title: '分管领导工号',
    align: "center",
    dataIndex: 'epmPerson1'
  },
  {
    title: '分管领导姓名',
    align: "center",
    dataIndex: 'epmPerson1Name'
  },
  {
    title: '主要领导工号',
    align: "center",
    dataIndex: 'epmPerson2'
  },
  {
    title: '主要领导姓名',
    align: "center",
    dataIndex: 'epmPerson2Name'
  },
  {
    title: '其它分管领导工号',
    align: "center",
    dataIndex: 'epmPerson3'
  },
  {
    title: '其它分管领导姓名',
    align: "center",
    dataIndex: 'epmPerson3Name'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'orgName',
    label: '部门名称',
    component: 'Input',
  },
  {
    field: 'parentOrgCode',
    label: '上级部门',
    component: 'Input',
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '部门编码',
    field: 'orgCode',
    component: 'Input',
  },
  {
    label: '部门名称',
    field: 'orgName',
    component: 'Input',
  },
  {
    label: '分析类型',
    field: 'analysisType',
    component: 'Input',
  },
  {
    label: '父部门编码',
    field: 'parentOrgCode',
    component: 'Input',
    dynamicDisabled: () => true,
  },
  {
    label: '父部门名称',
    field: 'parentOrgName',
    component: 'Input',
    dynamicDisabled: () => true,
  },
  {
    label: '适用单位',
    field: 'suitUnit',
    component: 'Input',
    dynamicDisabled: () => true,
  },
  {
    label: '负责人岗位编码',
    field: 'posCode',
    component: 'Input',
  },
  {
    label: '负责人岗位名称',
    field: 'posName',
    component: 'Input',
  },
  {
    label: '部门绩效兼职工号',
    field: 'pluraList',
    component: 'Input',
  },
  {
    label: '部门绩效兼职姓名',
    field: 'pluraNameList',
    component: 'Input',
  },
  {
    label: '部门负责人工号',
    field: 'psnNum',
    component: 'Input',
  },
  {
    label: '部门负责人名称',
    field: 'psnName',
    component: 'Input',
  },
  {
    label: '是否考核',
    field: 'isAssess',
    component: 'Input',
  },
  {
    label: '显示排序',
    field: 'displayOrder',
    component: 'InputNumber',
  },
  {
    label: '分管领导工号',
    field: 'epmPerson1',
    component: 'Input',
  },
  {
    label: '分管领导姓名',
    field: 'epmPerson1Name',
    component: 'Input',
  },
  {
    label: '主要领导工号',
    field: 'epmPerson2',
    component: 'Input',
  },
  {
    label: '主要领导姓名',
    field: 'epmPerson2Name',
    component: 'Input',
  },
  {
    label: '其它分管领导工号',
    field: 'epmPerson3',
    component: 'Input',
  },
  {
    label: '其它分管领导姓名',
    field: 'epmPerson3Name',
    component: 'Input',
  },
];

// 高级查询数据
export const superQuerySchema = {
  orgCode: { title: '部门编码', order: 0, view: 'text', type: 'string', },
  orgName: { title: '部门名称', order: 1, view: 'text', type: 'string', },
  deptId: { title: 'km部门ID', order: 2, view: 'number', type: 'number', },
  parentDeptId: { title: 'km部门父级ID', order: 3, view: 'number', type: 'number', },
  orgType: { title: '部门类型', order: 4, view: 'text', type: 'string', },
  analysisType: { title: '分析类型', order: 5, view: 'text', type: 'string', },
  parentOrgCode: { title: '父部门编码', order: 6, view: 'text', type: 'string', },
  parentOrgName: { title: '父部门名称', order: 7, view: 'text', type: 'string', },
  secorgCode: { title: '责任部门编码', order: 8, view: 'text', type: 'string', },
  secorgName: { title: '责任部门名称', order: 9, view: 'text', type: 'string', },
  suitUnit: { title: '适用单位', order: 10, view: 'text', type: 'string', },
  posCode: { title: '负责人岗位编码', order: 11, view: 'text', type: 'string', },
  posName: { title: '负责人岗位名称', order: 12, view: 'text', type: 'string', },
  pluraList: { title: '部门绩效兼职工号', order: 13, view: 'text', type: 'string', },
  pluraNameList: { title: '部门绩效兼职姓名', order: 14, view: 'text', type: 'string', },
  psnNum: { title: '部门负责人工号', order: 15, view: 'text', type: 'string', },
  psnName: { title: '部门负责人名称', order: 16, view: 'text', type: 'string', },
  isAssess: { title: '是否考核', order: 17, view: 'text', type: 'string', },
  displayOrder: { title: '显示排序', order: 18, view: 'number', type: 'number', },
  sysCreatorId: { title: '创建人', order: 19, view: 'text', type: 'string', },
  sysCreateDate: { title: '创建日期', order: 20, view: 'datetime', type: 'string', },
  sysUpdatorId: { title: '修改人', order: 21, view: 'text', type: 'string', },
  sysUpdateDate: { title: '修改日期', order: 22, view: 'datetime', type: 'string', },
  sysDeptId: { title: '归属部门标识', order: 23, view: 'text', type: 'string', },
  sysCompanyId: { title: '归属单位标识', order: 24, view: 'text', type: 'string', },
  epmPerson1: { title: '分管领导工号', order: 25, view: 'text', type: 'string', },
  epmPerson1Name: { title: '分管领导姓名', order: 26, view: 'text', type: 'string', },
  epmPerson2: { title: '主要领导工号', order: 27, view: 'text', type: 'string', },
  epmPerson2Name: { title: '主要领导姓名', order: 28, view: 'text', type: 'string', },
  epmPerson3: { title: '其它分管领导工号', order: 29, view: 'text', type: 'string', },
  epmPerson3Name: { title: '其它分管领导姓名', order: 30, view: 'text', type: 'string', },
  epmPerson1OrgCode: { title: 'epmPerson1OrgCode', order: 31, view: 'text', type: 'string', },
  epmPerson1OrgName: { title: 'epmPerson1OrgName', order: 32, view: 'text', type: 'string', },
  epmPerson1PosCode: { title: 'epmPerson1PosCode', order: 33, view: 'text', type: 'string', },
  epmPerson1PosName: { title: 'epmPerson1PosName', order: 34, view: 'text', type: 'string', },
  pluraListEpm: { title: '一级绩效经理绩效兼职', order: 35, view: 'text', type: 'string', },
  epmPerson2OrgCode: { title: 'epmPerson2OrgCode', order: 36, view: 'text', type: 'string', },
  epmPerson2OrgName: { title: 'epmPerson2OrgName', order: 37, view: 'text', type: 'string', },
  epmPerson2PosCode: { title: 'epmPerson2PosCode', order: 38, view: 'text', type: 'string', },
  epmPerson2PosName: { title: 'epmPerson2PosName', order: 39, view: 'text', type: 'string', },
  isProorg: { title: '是否专业部门', order: 40, view: 'text', type: 'string', },
  path: { title: 'path', order: 41, view: 'text', type: 'string', },
  isIntensification: { title: '是否集约化处理', order: 42, view: 'text', type: 'string', },
  isIntensificationFlag: { title: '是否集约化状态', order: 43, view: 'text', type: 'string', },
  isIntensificationList: { title: '集约化列表', order: 44, view: 'textarea', type: 'string', },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}